<?php
$pic_types = array("jpg", "jpeg", "gif", "png");

$text_file = substr ($_REQUEST["image_id"],0,strpos($_REQUEST["image_id"],".")) . ".html";
$text_file ="{$_SERVER["DOCUMENT_ROOT"]}" . $text_file;
$html = $_REQUEST["html"];
//
if (file_put_contents($text_file, $html)) echo "success";
else echo "Error saving $text_file\n{$html}";
?>

